package com.tf.xx.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;

@Component //将类交给Spring管理
//主要作用是将配置文件中的属性值注入到该类中。参数是prefix指的是配置文件中的属性的父级节点
@ConfigurationProperties(prefix = "user")
@Data

@TableName("user")
//@NoArgsConstructor  //自动生成无参构造
//@AllArgsConstructor  //自动生成全参构造
public class User implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String username;
    private String email;
    private String password;
}
@Data
class Grade{
    private String subject;
    private Integer score;
}